﻿using System.Collections.Generic;

namespace DimensionsHelper.Common.Contracts.DataCollector.Options;

/// <summary>
///     用于配置两列数据计算差值的设置，包括阈值、文本标识等
/// </summary>
public class Gap : INamedObject
{
    /// <summary>
    ///     计算使用的类型名
    /// </summary>
    public string Type { get; set; } = string.Empty;

    /// <summary>
    ///     计算使用的类型值
    /// </summary>
    public string TypeValue { get; set; } = string.Empty;

    /// <summary>
    ///     计算此Gap时，左值数据的索引
    /// </summary>
    public int LeftIndex { get; set; } = -1;

    /// <summary>
    ///     计算此Gap时，右值数据的索引
    /// </summary>
    public int RightIndex { get; set; } = -1;

    /// <summary>
    ///     当前Gap使用的索引配置
    /// </summary>
    public IList<GapIndex> Indices { get; set; } = new List<GapIndex>();

    /// <summary>
    ///     配置Gap结果的文本标记
    /// </summary>
    public string Mark { get; set; } = string.Empty;

    /// <summary>
    ///     配置Gap结果的阈值定义
    /// </summary>
    public string Threshold { get; set; } = string.Empty;

    /// <summary>
    ///     筛选节点使用的表达式，优先级大于 Identifiers，如果不使用，设置成空字符串
    /// </summary>
    public string Expression { get; set; } = string.Empty;

    /// <summary>
    ///     计算Gap的特定类型和名称
    /// </summary>
    public IList<GapIdentifier> Identifiers { get; set; } = new List<GapIdentifier>();

    /// <summary>
    ///     Gap配置名
    /// </summary>
    public string Name { get; set; } = string.Empty;
}